{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "93ef4e07",
   "metadata": {},
   "source": [
    "## 1.列表\n",
    "### 作用：列表类型专门用来记录多个同种属性的值"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "597c07f8",
   "metadata": {},
   "source": [
    "## 2.%格式符，或者叫占位符\n",
    "### 表示格式化操作，将其转化成相应的数据类型\n",
    "### 例如：%s占位符：字符串，采用str（）的显示，并将数据转化为字符串形式"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "9a4e922d",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (<ipython-input-1-2437c9d4d26b>, line 2)",
     "output_type": "error",
     "traceback": [
      "\u001b[0;36m  File \u001b[0;32m\"<ipython-input-1-2437c9d4d26b>\"\u001b[0;36m, line \u001b[0;32m2\u001b[0m\n\u001b[0;31m    print (string=%s\" % string) # %s打印时被替换为hello\u001b[0m\n\u001b[0m                  ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "string=\"hello\"\n",
    "print (string=%s\" % string) # %s打印时被替换为hello\n",
    "# output: string=hello"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "e7c0474b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "A\n",
      "666\n",
      "99\n"
     ]
    }
   ],
   "source": [
    "#以下是列表\n",
    "\n",
    "\n",
    "names = \"A,B,C,D\"\n",
    "\n",
    "print(names[0])\n",
    "\n",
    "names_list = [\"A\",\"B\",\"C\"]\n",
    "\n",
    "password_list = [666,888,233]\n",
    "\n",
    "age_list = [99,4,78]\n",
    "\n",
    "# 以下是列表的嵌套\n",
    "\n",
    "info_list= [[\"A\",666,99],[\"B\",888,4]]\n",
    "\n",
    "print(password_list[0])\n",
    "\n",
    "print(age_list[0])\n",
    "\n",
    "names = [\"G\",\"H\",\"J\",\"L\"]\n",
    "\n",
    "\n",
    "# 知识点slices(切片)数值是指values在list中的位置"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5f7a59ff",
   "metadata": {},
   "source": [
    "## 2.用户输入"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "749d858f",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Author:ZuQY\n",
    "\n",
    "# username = input(\"请输入正确的账号:\")\n",
    "# password = input(\"请输入正确的密码:\")\n",
    "\n",
    "'''\n",
    "count = 0\n",
    "while True\n",
    "   count = count + 1\n",
    "   print(\"巴拉拉能量\")\n",
    "   if count == 10:\n",
    "    break\n",
    "'''\n",
    "user_data = [\"ZQY\",\"DML\"]\n",
    "user_password = \"777777\"\n",
    "count = 3\n",
    "while True:\n",
    "    username = input(\"请输入正确的账号:\")\n",
    "    password = input(\"请输入正确的密码:\")\n",
    "    count  -= 1\n",
    "    if username == user_data:\n",
    "        if password == user_password:\n",
    "            print(\"登陆成功，欢迎\",username,\"使用~\")\n",
    "            # 账号和密码都是是正确的情况下\n",
    "            break\n",
    "        else:\n",
    "            if count == 0:\n",
    "                print(\"您的账号被锁定了，要5分钟之后才可以尝试\")\n",
    "                break\n",
    "            else:\n",
    "                print(\"您的账号或密码不正确，请重新输入，您还有%s次机会\"%(count))\n",
    "\n",
    "\n",
    "    else:\n",
    "        if count == 0:\n",
    "            print(\"您的账号被锁定了，要5分钟之后才可以尝试\")\n",
    "            break\n",
    "        else:\n",
    "            (\"您的账号或密码不正确，请重新输入，您还有\", count, \"次机会\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "08b68929",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
